<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@ page session="true"%>
<%@page import="java.util.*"%>
<%@page import="tr.com.argela.tap.mot.models.Project"%>
<%@page import="tr.com.argela.tap.mot.models.Module"%>
<%@page import="tr.com.argela.tap.mot.models.User"%>
<%@page import="tr.com.argela.tap.mot.models.TestPoint"%>
<%@page import="tr.com.argela.tap.mot.models.TestCase"%>
<%@page import="tr.com.argela.tap.mot.dao.ModuleDao"%>
<%@page import="tr.com.argela.tap.mot.dao.ProjectDao"%>
<%@page import="tr.com.argela.tap.mot.dao.TestPointDao"%>
<%@page import="tr.com.argela.tap.mot.dao.TestCaseDao"%>
<%@page import="tr.com.argela.tap.mot.dao.AuthenticationDao"%>
<%@page import="java.sql.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
   <%
     User user = (User)request.getSession().getAttribute("userObject");
     String name = user.getName();
     Long id =user.getId();
%>
   
   <html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <link rel="stylesheet" type="text/css" href="style/styles.css">
    </head>
    <body>
      	<h4 align="right"> <%=name%></h4>
      	<h5 align="right"><a href="logout.jsp">Log out</a></h5>
       <div  align="center"> <h1 align="center">MOT</h1><h5 align="center">Memory Of Testing</h5></div>
        
       <div align="left">
        <table align="left"><tr><td>
        <h3><a href="analystModel.jsp?id=<%=id%>">Modules</a></h3></td></tr><tr><td>
        <h3><a href="analystPoint.jsp?id=<%=id%>">Test points</a></h3></td></tr><tr><td>
        <h3><a href="analystCase.jsp?id=<%=id%>">Test Cases</a></h3></td></tr><tr><td>
        <h3><a href="export.jsp?id=<%=id%>">Export Document</a></h3></td></tr>
        </table></div>
       <dıv align="right"> 
    
    <form action="TestCaseServlet">
    
    <table border="3" align="center">
    <% 
//call db method



if(request.getParameter("id16")==null)
{	response.sendRedirect("testcases2.jsp");
	return;
}
TestCaseDao caseDao = new TestCaseDao();

TestCase testcase = caseDao.checktcase(Long.parseLong((String)request.getParameter("id16")));

%>
    <tr><th colspan="2"> Update Test Case </th></tr>
    <tr><td>Name: </td><td><input type="text" name="tcasename" value="<%=testcase.getName()%>"></td></tr>
    <tr><td>Bussiness Requirement: </td><td><input type="text" name="breq" value="<%=testcase.getBreq()%>"></td></tr>
    <tr><td>Precondition </td><td><input type="text" name="precon" value="<%=testcase.getPrecondition()%>"></td></tr>
   	<tr><td>Expected Result</td><td><input type="text" name="expected" value="<%=testcase.getExpectedRes()%>"></td></tr>
    <tr><td>Description: </td><td><input type="text" name="casedescription" value="<%=testcase.getDescription() %>"></td></tr>
    <tr><td>Check Item </td><td><input type="text" name="check" value="<%=testcase.getCheck()%>"></td></tr>
	<tr><td>User </td><td><input  type="hidden" name="username" id="username" value="<%=testcase.getUser().getId()%>"><input type="text" readonly="readonly" name="user" value="<%=testcase.getUser().getName()%>"></td></tr>
	
	<tr><td> Test Point : </td><td><input  type="hidden" name="pname" id="pname" value="<%=testcase.getTestPoint().getId()%>"><input type="text" readonly="readonly" name="point" value="<%=testcase.getTestPoint().getName()%>"></td></tr>
	
    <tr><td colspan="2">
    <input  type="hidden" name="caseId" id="caseId" value="<%=testcase.getId()%>">
    <input  type="hidden" name="case" id="case" value="updatecase2">
    <input type="submit" name="updatecase" value="Save">
    <input type="reset" name="cancel" value="Cancel">
    </td></tr>
    </table>
    </form>
    </dıv>